package com.china08.yxyapi.entity.mg.lecture;

import java.util.Date;
import java.util.List;

import javax.persistence.Id;

import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import com.china08.yxyapi.entity.mg.MongoBaseEntityNoId;

/**
 * @author Richard.Wang
 * @descript 授课资源包
 */
@Document(collection = "yxy.tea.lecture.pack")
public class YxyLecturePack extends MongoBaseEntityNoId {

    private static final long serialVersionUID = -295018179334903779L;

    @Id
    private String id;

    @Indexed
    @Field(value = "user_id")
    private String userId;

    @Field(value = "user_nick")
    private String userNick;

    @Field(value = "school_id")
    private String schoolId;

    @Field(value = "school_nick")
    private String schoolNick;

    /**
     * 学段id
     */
    @Field(value = "phase_id")
    private String phaseId;

    /**
     * 学段名称
     */
    @Field(value = "phase_name")
    private String phaseName;

    /**
     * 学科id
     */
    @Field(value = "subject_id")
    private String subjectId;

    /**
     * 学科名称
     */
    @Field(value = "subject_name")
    private String subjectName;

    /**
     * 版本id
     */
    @Field(value = "version_id")
    private String versionId;

    /**
     * 版本名称
     */
    @Field(value = "version_name")
    private String versionName;

    /**
     * 学期id
     */
    @Field(value = "semester_id")
    private String semesterId;

    /**
     * 学期名称，一年级上册，必修，选修
     */
    @Field(value = "semester_name")
    private String semesterName;

    /**
     * 目录id
     */
    @Field(value = "bookcontents_id")
    private String bookcontentsId;

    /**
     * 目录id
     */
    @Field(value = "bookcontents_Name")
    private String bookcontentsName;

    @Field(value = "pack_name")
    private String packName;

    /**
     * 资源id
     */
    @Field(value = "resource")
    private List<Res> resources;

    /**
     * 备授课时间
     */
    @Field(value = "pre_date")
    private Date preDate;

    /**
     * 是否分享 0——私有 1——分享
     */
    @Field(value = "share")
    private Integer share = 0;

    /**
     * 授课班级
     */
    @Field(value = "class_id")
    private String classId;

    /**
     * 授课班级名称
     */
    @Field(value = "class_name")
    private String className;

    /**
     * 授课班级名称
     */
    @Field(value = "pack_size")
    private Long packSize;

    /**
     * 是否使用
     */
    @Field(value = "isUse")
    private boolean isUse = false;

    /**
     * 使用次数，点击打开就进行加1
     */
    @Field(value = "used_count")
    private Long usedCount = 1l;

    /**
     * 教学使用次数， 在页面停留一定时间之后进行加1
     */
    @Field(value = "teaching_count")
    private Long teachingCount = 1l;

    /**
     * 使用时间
     */
    @Field(value = "use_date")
    private Integer useDate;

    public class Res {
        private String resourceId;
        private String resourceName;
        private String resourceUrl;
        private String formatId;
        private Integer orderNum;
        private Integer fileSize;

        // 0 试题 1资源
        private int courseType = 0;

        // 增加资源用途 ---教学
        private Integer usesTeaching = 0;
        // 增加资源用途 ---预习作业
        private Integer usesProview = 0;

        // 增加资源用途 ---课后作业
        private Integer usesHomework = 0;
        // 增加资源用途 ---测试
        private Integer usesTest = 0;

        public Integer getOrderNum() {
            return orderNum;
        }

        public void setOrderNum(Integer orderNum) {
            this.orderNum = orderNum;
        }

        public int getCourseType() {
            return courseType;
        }

        public void setCourseType(int courseType) {
            this.courseType = courseType;
        }

        public String getFormatId() {
            return formatId;
        }

        public void setFormatId(String formatId) {
            this.formatId = formatId;
        }

        public String getResourceId() {
            return resourceId;
        }

        public void setResourceId(String resourceId) {
            this.resourceId = resourceId;
        }

        public String getResourceUrl() {
            return resourceUrl;
        }

        public void setResourceUrl(String resourceUrl) {
            this.resourceUrl = resourceUrl;
        }

        public String getResourceName() {
            return resourceName;
        }

        public void setResourceName(String resourceName) {
            this.resourceName = resourceName;
        }

        public Integer getUsesTeaching() {
            return usesTeaching;
        }

        public void setUsesTeaching(Integer usesTeaching) {
            this.usesTeaching = usesTeaching;
        }

        public Integer getUsesProview() {
            return usesProview;
        }

        public void setUsesProview(Integer usesProview) {
            this.usesProview = usesProview;
        }

        public Integer getUsesHomework() {
            return usesHomework;
        }

        public void setUsesHomework(Integer usesHomework) {
            this.usesHomework = usesHomework;
        }

        public Integer getUsesTest() {
            return usesTest;
        }

        public void setUsesTest(Integer usesTest) {
            this.usesTest = usesTest;
        }

        public Integer getFileSize() {
            return fileSize;
        }

        public void setFileSize(Integer fileSize) {
            this.fileSize = fileSize;
        }

    }

    public String getBookcontentsName() {
        return bookcontentsName;
    }

    public void setBookcontentsName(String bookcontentsName) {
        this.bookcontentsName = bookcontentsName;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(String schoolId) {
        this.schoolId = schoolId;
    }

    public String getPhaseId() {
        return phaseId;
    }

    public void setPhaseId(String phaseId) {
        this.phaseId = phaseId;
    }

    public String getPhaseName() {
        return phaseName;
    }

    public void setPhaseName(String phaseName) {
        this.phaseName = phaseName;
    }

    public String getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(String subjectId) {
        this.subjectId = subjectId;
    }

    public String getSubjectName() {
        return subjectName;
    }

    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }

    public String getVersionId() {
        return versionId;
    }

    public void setVersionId(String versionId) {
        this.versionId = versionId;
    }

    public String getVersionName() {
        return versionName;
    }

    public void setVersionName(String versionName) {
        this.versionName = versionName;
    }

    public String getSemesterId() {
        return semesterId;
    }

    public void setSemesterId(String semesterId) {
        this.semesterId = semesterId;
    }

    public String getSemesterName() {
        return semesterName;
    }

    public void setSemesterName(String semesterName) {
        this.semesterName = semesterName;
    }

    public String getBookcontentsId() {
        return bookcontentsId;
    }

    public void setBookcontentsId(String bookcontentsId) {
        this.bookcontentsId = bookcontentsId;
    }

    public String getPackName() {
        return packName;
    }

    public void setPackName(String packName) {
        this.packName = packName;
    }

    public List<Res> getResources() {
        return resources;
    }

    public void setResources(List<Res> resources) {
        this.resources = resources;
    }

    public Date getPreDate() {
        return preDate;
    }

    public void setPreDate(Date preDate) {
        this.preDate = preDate;
    }

    public Integer getShare() {
        return share;
    }

    public void setShare(Integer share) {
        this.share = share;
    }

    public String getClassId() {
        return classId;
    }

    public void setClassId(String classId) {
        this.classId = classId;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getUserNick() {
        return userNick;
    }

    public void setUserNick(String userNick) {
        this.userNick = userNick;
    }

    public String getSchoolNick() {
        return schoolNick;
    }

    public void setSchoolNick(String schoolNick) {
        this.schoolNick = schoolNick;
    }

    public Long getPackSize() {
        return packSize;
    }

    public void setPackSize(Long packSize) {
        this.packSize = packSize;
    }

    public boolean isUse() {
        return isUse;
    }

    public void setUse(boolean isUse) {
        this.isUse = isUse;
    }

    public Integer getUseDate() {
        return useDate;
    }

    public void setUseDate(Integer useDate) {
        this.useDate = useDate;
    }

    public Long getUsedCount() {
        return usedCount;
    }

    public void setUsedCount(Long usedCount) {
        this.usedCount = usedCount;
    }

    public Long getTeachingCount() {
        return teachingCount;
    }

    public void setTeachingCount(Long teachingCount) {
        this.teachingCount = teachingCount;
    }

}
